<template>
  <input type="checkbox" class="switch" >
</template>

<script type="text/ecmascript-6">
  export default {};
</script>

<style lang="scss" scoped>
  .switch{
    position: relative;
    width: 52px;
    height: 30px;
    border: 1px solid #dfdfdf;
    outline: none;
    border-radius: 16px;
    background-color: #dfdfdf;
    -webkit-appearance: button;
    -moz-appearance: button;
    appearance: button;
  }
  .switch:before,.switch:after{
    content:'';
    position: absolute;
    top: 0;
    left: 0;
    height: 28px;
    border-radius: 15px;
  }
  .switch:before{
    width: 50px;
    background-color: #fdfdfd;
  }
  .switch:after{
    width: 28px;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.4);
  }
  .switch:checked:before{
    transform: scale(0);
  }
  .switch:checked:after{
    content: '';
    transform: translateX(21px);
  }
  .switch:checked{
    border-color: #41B883;
    background-color: #41B883;
  }
</style>
